<template>
	<view class="success_index">
		<ABannerTab :itemData="childArr"></ABannerTab>
		<view class="detail_index">

			<span v-if="item.orderStatus===-1">等待付款</span>
			<span v-if="item.orderStatus===0">支付成功正在出货</span>
			<span v-if="item.orderStatus===1">已退款</span>
			<span v-if="item.orderStatus===2">退款失败</span>
			<span v-if="item.orderStatus===3">退款成功</span>
			<span v-if="item.orderStatus===4">出货失败</span>
			<span v-if="item.orderStatus===5">出货成功</span>
			<span v-if="item.orderStatus===6">出货超时</span>
			<span v-if="item.orderStatus===7">支付失败</span>
			<span v-if="item.orderStatus===8">支付中</span>
			<span v-if="item.orderStatus===9">退款中</span>
			<span v-if="item.orderStatus===10">订单已取消</span>

			<view v-if="itemData.orderStatus===-1" class="tips_title">
				等待付款
			</view>
			<view v-if="itemData.orderStatus===0" class="tips_title">
				支付成功正在出货
			</view>
			<view v-if="itemData.orderStatus===1" class="tips_title">
				已退款
			</view>
			<view v-if="itemData.orderStatus===2" class="tips_title">
				退款失败
			</view>
			<view v-if="itemData.orderStatus===3" class="tips_title">
				退款成功
			</view>
			<view v-if="itemData.orderStatus===4" class="tips_title">
				出货失败
			</view>
			<view v-if="itemData.orderStatus===5" class="tips_title">
				出货成功
			</view>

			<view v-if="itemData.orderStatus===6" class="tips_title">
				订单超时
			</view>
			<view v-if="itemData.orderStatus===7" class="tips_title">
				支付失败
			</view>
			<view v-if="itemData.orderStatus===8" class="tips_title">
				支付中
			</view>
			<view v-if="itemData.orderStatus===9" class="tips_title">
				退款中
			</view>
			<view v-if="itemData.orderStatus===10" class="tips_title">
				订单已取消
			</view>
			<view class="shop_detail">
				<view class="pic_content">
					<image :src="itemData.machineProduct.realProductImgUrl" mode="widthFix"></image>
				</view>
				<view class="content">
					<view class="title1">
						{{itemData.machineProduct.productName}}
						<span>￥{{itemData.machineProduct.price}}</span>
					</view>
					<view class="description">
						超熟睡420柔棉感量多夜用纤巧棉柔 4片/包
					</view>
					<view class="category">
						棉柔|夜用
					</view>
				</view>
			</view>
			<view v-if="itemData.orderStatus===0" class="price_title">
				已付款{{itemData.totalPrice}}元
			</view>
			<view v-if="itemData.orderStatus===6" class="price_title">
				应付款{{itemData.totalPrice}}元
			</view>
			<view v-if="itemData.orderStatus===-1" class="price_title">
				待付款{{itemData.totalPrice}}元
			</view>
			<view class="shop_info_desc">
				<view class="shop_item">
					<view class="shop_num">
						订单编号:
					</view>
					<view class="value">
						{{itemData.orderId}}
					</view>
				</view>
				<view class="shop_item">
					<view class="shop_num">
						商品编号:
					</view>
					<view class="value">
						{{itemData.machineProduct.productId}}
					</view>
				</view>
				<view class="shop_item">
					<view class="shop_num">
						库存:
					</view>
					<view class="value">
						{{itemData.machineProduct.capacity}}
					</view>
				</view>
				<view class="shop_item">
					<view class="shop_num">
						货道口:
					</view>
					<view class="value">
						{{itemData.machineProduct.slotNo}}
					</view>
				</view>
				<view class="shop_item">
					<view class="shop_num">
						当前出货机器:
					</view>
					<view class="value">
						{{itemData.machineProduct.mid}}
					</view>
				</view>
				<view class="shop_item">
					<view class="shop_num">
						下单时间:
					</view>
					<view class="value">
						{{itemData.createTime}}
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import {
		getShop
	} from '@/api/order.js'
	export default {
		data() {
			return {
				paramsData: {},
				itemData: {},
				childArr: []
			}
		},
		methods: {},
		onLoad(options) {
			let decodeURIComponentStr = decodeURIComponent(options.item);
			this.paramsData = JSON.parse(decodeURIComponentStr);
			console.log('itemData', this.itemData);
			getShop(this.paramsData.orderId).then(res => {
				this.itemData = res.data
				if (this.itemData.orderStatus === -1)
					this.childArr.push('待付款')
				else if (this.itemData.orderStatus === 0)
					this.childArr.push('已付款')
				else if (this.itemData.orderStatus === 6)
					this.childArr.push('已超时')
			})
		},
	}
</script>

<style scoped lang="scss">
	.success_index {
		.detail_index {
			background-color: #fff;
			border-radius: 10rpx;
			// margin-top: -30rpx;
			width: 95%;
			margin: -20rpx auto;
			margin-bottom: 40rpx;

			/deep/ .u-radio-group {
				display: flex;
				flex-direction: column;
			}

			.item_container {
				display: flex;
				flex-direction: column;

				.item_info {

					margin: 30rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;

					.info_item {}

					image {
						padding: 0 20rpx;
						width: 40rpx;
						height: 40rpx;
					}


				}

			}

			.tips_title {
				font-size: 36rpx;
				color: #F86853;
				padding: 20rpx 30rpx;
			}

			.shop_detail {
				display: flex;
				justify-content: flex-start;
				align-items: center;
				width: 100%;
				padding: 20rpx;

				.pic_content {
					width: 30%;

					image {
						width: 100%;
					}
				}

				.content {
					width: 70%;
					margin-left: 20rpx;

					.title1 {
						font-size: 36rpx;

						span {
							font-size: 38rpx;
							float: right;
							font-weight: bold;
						}

					}

					.description {
						margin: 20rpx 0;
						letter-spacing: 0.10rem;
					}

					.category {
						font-size: 24rpx;
						color: #B0B0B0;
					}
				}
			}

			.price_title {
				// float: right;
				text-align: right;
				font-size: 38rpx;
				margin: 20rpx 70rpx;
			}

			.shop_info_desc {
				padding: 20rpx;

				.shop_item {
					margin: 20rpx 0;
					display: flex;
					justify-content: space-between;
					align-items: center;

					.value {
						color: #A9A9A9;
					}
				}
			}

		}
	}
</style>